import random
lst1 = []
d1 = {}
for i in range(20):
    random_num = random.randint(1,20)
    lst1.append(random_num)
s = set(lst1)
for k in s:
     d1.update({k:lst1.count(k)})
print(d1)
lst2 = list(d1.items())
lst3 = sorted(lst2,key=lambda x:x[1],reverse=True)
print(lst3)
print(lst3[:3])


# 完成的不错
